package com.java.quartz;


import com.java.instant.MqConst;
import com.java.service.RabbitService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Api("定时任务")
@Component
@EnableScheduling
public class ScheduledTask {

    @Autowired
    private RabbitService rabbitService;

    //每天8小时提醒
    @Scheduled(cron="0 0 8 * * ?")
    public void task(){
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,MqConst.QUEUE_TASK_8,"");
    }
}
